package com.rd.sys.service.analysis.scheme;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import com.rd.sys.dto.client.analysis.AoiData;
import com.rd.sys.dto.client.store.Material;
import com.rd.sys.dto.client.store.Question;
import com.rd.sys.dto.client.store.Scheme;

public interface SchemeService {

    /**
     * 查询方案描述详情
     * 
     * @param userCode
     * @param projectCode
     * @return
     */
    public List<Scheme> querySchemeList(String userCode, String projectCode);

    /**
     * 查询某个指定的方案
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @return
     */
    public Scheme queryScheme(String userCode, String projectCode, String schemeCode);

    /**
     * 查询某个方案的素材详情
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @return
     */
    public List<Material> queryMaterialList(String userCode, String projectCode, String schemeCode);

    /**
     * 查询某个方案的指定素材
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param materialCode
     * @return
     */
    public Material queryMaterial(String userCode, String projectCode, String schemeCode, String materialCode);

    /**
     * 展示素材图片
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param materialName
     * @param response
     */
    public void showMaterialImage(String userCode, String projectCode, String schemeCode, String materialCode,
            String materialSuffix, HttpServletResponse response);

    /**
     * 从方案描述文件中读取方案信息
     * 
     * @param key
     * @return
     * @throws Exception
     */
    public List<Scheme> readSchemeList(String key) throws Exception;

    /**
     * 同步方案信息
     * 
     * @param userno
     * @param userCode
     * @param projectCode
     * @param scheme
     *            待新增的方案
     * @param opercode
     *            操作代码
     * @throws Exception
     */
    public void syncScheme(Integer userno, String userCode, String projectCode, Scheme scheme, String opercode)
            throws Exception;

    /**
     * 查询某个被试属性详情
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param attributeNo
     *            属性No
     * @return
     */
    public Question queryResultAttribute(String userCode, String projectCode, String schemeCode, Integer attributeNo)
            throws Exception;

    /**
     * 从AOI数据文件中读取AOI的图形信息
     * 
     * @param key
     * @return
     * @throws Exception
     */
    public List<AoiData> readAoiDataList(String key) throws Exception;

    /**
     * 同步AOI信息
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param aoiGraphsList
     *            待更新的AOI信息
     * @throws Exception
     */
    public void syncAoiData(String userCode, String projectCode, String schemeCode, List<AoiData> aoiGraphsList)
            throws Exception;

    /**
     * 查询某个方案中的AOI信息
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @return
     */
    public List<AoiData> queryAoiData(String userCode, String projectCode, String schemeCode);

    /**
     * 查询某个方案中的某个指定AOI信息
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @return
     */
    public AoiData queryAoiData(String userCode, String projectCode, String schemeCode, int aoiIndex);

    /**
     * 同步AOI信息
     * 
     * @param userCode
     * @param projectCode
     * @param schemeCode
     * @param aoiGraphsList
     *            待更新的AOI信息
     * @throws Exception
     */
    public void saveAoiData(String userCode, String projectCode, String schemeCode, AoiData aoiGraph);
}
